package cn.com.joco.dk.webby.service.user;

import javax.annotation.Resource;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import cn.com.joco.dk.webby.dao.user.UserDao;
import cn.com.joco.dk.webby.model.User;

@Service
public class UserServiceImpl implements UserService{
	
	@Resource
	private UserDao userDao;

	@Override
	public Page<User> findByPage(Pageable pageable, String name, int status) {
		// TODO Auto-generated method stub
		
		return (Page<User>) userDao.findByPage(pageable, name, status);
	}
	
	@Override
	public User findById(long id) {
		// TODO Auto-generated method stub
		return userDao.findById(id);
	}

	@Override
	public void updateStatus(int status, long id) {
		// TODO Auto-generated method stub
		userDao.updateStatus(status, id);
	}

	@Override
	public void updateLoginId(User user) {
		// TODO Auto-generated method stub
		userDao.updateLoginId(user);
	}

	@Override
	public void save(User user) {
		// TODO Auto-generated method stub
		userDao.save(user);
	}

	@Override
	public void update(User user) {
		// TODO Auto-generated method stub
		userDao.update(user);
	}

	@Override
	public User findByloginId(String loginId) {
		// TODO Auto-generated method stub
		return userDao.findByloginId(loginId);
	}

	
}
